<?php
include_once('common.inc.php');
if( get_param('submit') ){
	$feeModel = new Model('feedback');
	$data = get_data();
	$data['addtime'] = time();
	$rs = $feeModel->value($data)->add();
	if( $rs>0 ){
		msg('您的反馈已提交，我们将尽快给您答复。', 'contact.php');
	}else{
		msg('提交失败', 'contact.php');
	}
	exit;
}
$smarty = new Tpl();
//product
$proModel = new Model('product');
$product = $proModel->order('`order`,`id` DESC')->get();
$smarty->assign("product", $product);

//banner
$advModel = new Model('advertise');
$banners = $advModel->where('`type`=1')->order('`order`')->get();
$smarty->assign("banners", $banners);
$smarty->display('contact.html');
